<Window x:Class="Paladyne.FileSearch.UI.ShellView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro" MinWidth="600" MinHeight="715" Loaded="Window_Loaded" cal:Message.Attach="[Event KeyDown] = [KeyPressedOnView($eventArgs)]">
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition></RowDefinition>
		</Grid.RowDefinitions>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="*"></ColumnDefinition>
			<ColumnDefinition Width="100"></ColumnDefinition>
		</Grid.ColumnDefinitions>

		<StackPanel Grid.Row="0" Grid.Column="0">
			<!--Main search fields-->
			<GroupBox Margin="5" Header="Main search parameters">
				<Grid>
					<Grid.RowDefinitions>
						<RowDefinition Height="30"></RowDefinition>
						<RowDefinition Height="30"></RowDefinition>
						<RowDefinition Height="30"></RowDefinition>
						<RowDefinition Height="30"></RowDefinition>
						<RowDefinition Height="40"></RowDefinition>
						<RowDefinition></RowDefinition>
					</Grid.RowDefinitions>

					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="100"></ColumnDefinition>
						<ColumnDefinition></ColumnDefinition>
					</Grid.ColumnDefinitions>

					<!--Search string-->
					<TextBlock Margin="5" Grid.Row="0" Grid.Column="0">Search for:</TextBlock>
					<TextBox MaxLength="260" Height="22" Name="SearchString" Grid.Row="0" Grid.Column="1"></TextBox>

					<!--Search directory-->
                    <TextBlock Margin="5" Grid.Row="1" Grid.Column="0">Search in:</TextBlock>
					<TextBox MaxLength="260" Grid.Row="1" Grid.Column="1" Height="22" x:Name="DirectoryName"></TextBox>
					<Button Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Height="22" Width="22" Name="SelectFolder">&gt;&gt;</Button>
                    
					<!--Search in subdirs flag-->
					<CheckBox VerticalAlignment="Center" Name="SearchInSubdirectories" Grid.Row="2" Grid.Column="1">
						Search in subdirectories
					</CheckBox>

					<!--Size filter-->
					<CheckBox VerticalAlignment="Center" Margin="5" Grid.Row="3" Grid.Column="0" Name="FileSizeEnabled">File size:</CheckBox>
					<StackPanel Orientation="Horizontal" Grid.Row="3" Grid.Column="1" IsEnabled="{Binding ElementName=FileSizeEnabled, Path=IsChecked}">
						<ComboBox Height="22" Width="40" Name="FileSizeOperators" cal:Message.Attach="ChangeFileSizeOperator(FileSizeOperators)">
						</ComboBox>
						<TextBox Height="22" Width="100" x:Name="FileSize"></TextBox>
						<TextBlock Margin="5 0 5 0" VerticalAlignment="Center">kb</TextBlock>
					</StackPanel>

					<!--Date filter-->
					<CheckBox VerticalAlignment="Center" Margin="5" Grid.Row="4" Grid.Column="0" Name="DateEnabled">Date between:</CheckBox>
					<StackPanel Orientation="Horizontal" Grid.Row="4" Grid.Column="1" IsEnabled="{Binding ElementName=DateEnabled, Path=IsChecked}">
						<DatePicker Width="95" Height="24" Name="DateFrom" />
						<TextBlock Margin="5 0 5 0" VerticalAlignment="Center">and</TextBlock>
						<DatePicker Width="95" Height="24" Name="DateTo" />
					</StackPanel>

					<!--File attributes filter-->
					<CheckBox Margin="5" Grid.Row="5" Grid.Column="0" Name="AttributesEnabled">Attributes:</CheckBox>
					<StackPanel Orientation="Vertical" Grid.Row="5" Grid.Column="1" IsEnabled="{Binding ElementName=AttributesEnabled, Path=IsChecked}">
						<StackPanel Orientation="Horizontal">
							<CheckBox Width="80" Margin="0 0 10 0" Name="AttributeArchived" IsChecked="{x:Null}" IsThreeState="True">Archived</CheckBox>
							<CheckBox Width="80" Margin="0 0 10 0" Name="AttributeHidden" IsChecked="{x:Null}" IsThreeState="True">Hidden</CheckBox>
							<CheckBox Width="Auto" Margin="0 0 10 0" Name="AttributeEncrypted" IsChecked="{x:Null}" IsThreeState="True">Encrypted</CheckBox>
						</StackPanel>
						<StackPanel Orientation="Horizontal">
							<CheckBox Width="80" Margin="0 0 10 0" Name="AttributeReadonly" IsChecked="{x:Null}" IsThreeState="True">Read only</CheckBox>
							<CheckBox Width="80" Margin="0 0 10 0" Name="AttributeSystem" IsChecked="{x:Null}" IsThreeState="True">System</CheckBox>
							<CheckBox Width="Auto" Margin="0 0 10 0" Name="AttributeCompressed" IsChecked="{x:Null}" IsThreeState="True">Compressed</CheckBox>
						</StackPanel>
					</StackPanel>
				</Grid>
			</GroupBox>

			<!--Custom search module panel-->
			<GroupBox Margin="5" Header="Search module parameters" Name="SearchModuleHeader" HorizontalContentAlignment="Left">
				<StackPanel>
					<StackPanel HorizontalAlignment="Right" VerticalAlignment="Top" Orientation="Horizontal">
						<ComboBox Height="22" Width="70" Name="SearchModuleNames" cal:Message.Attach="SetCurrentSearchModule(SearchModuleNames)" />
						<Button Height="22" Width="80" Name="RefreshModules">Refresh</Button>
					</StackPanel>
					<ContentControl Margin="0 10 0 0" x:Name="ActiveItem" HorizontalAlignment="Stretch" />
				</StackPanel>

			</GroupBox>

			<!--Search results-->
			<GroupBox VerticalAlignment="Stretch" Height="280" Margin="5" Header="Search results">
				<ListBox VerticalAlignment="Top" Name="SearchResults" BorderThickness="0"></ListBox>
			</GroupBox>
			<TextBlock Margin="10 0 0 0" Name="SearchResultText">Search result text</TextBlock>
		</StackPanel>

		<!--Search start and cancel buttons-->
		<StackPanel Grid.Row="0" Grid.Column="1">
			<Button Margin="0 10 0 2" Height="22" Width="80" Name="StartSearch" Grid.Row="0" Grid.Column="2" Content="Start search" cal:Message.Attach="StartSearch" />
			<Button Margin="0 2 0 0" Height="22" Width="80" Name="CancelSearch" Grid.Row="1" Grid.Column="2" Content="Cancel" cal:Message.Attach="CancelSearch" />
		</StackPanel>

	</Grid>

</Window>